---
layout: m1x_rest
title: Product Images
---



<ul class="introduction-menu">
    <li><a href='#RESTAPI-Resource-ProductImages-RESTAPI-ProductImages'>REST API: Product Images</a>
    <ul>
        <li><a href='#RESTAPI-Resource-ProductImages-URI--products--productid-images'>URI: /products/:product_id/images</a>
        <ul>
            <li><a href='#RESTAPI-Resource-ProductImages-HTTPMethod-GET'>HTTP Method: GET</a></li>
            <li><a href='#RESTAPI-Resource-ProductImages-HTTPMethod-POST'>HTTP Method: POST</a></li>
        </ul>
        </li>
        <li><a href='#RESTAPI-Resource-ProductImages-URI--products--productid-images-store--storeid'>URI: /products/:product_id/images/store/:store_id</a>
        <ul>
            <li><a href='#RESTAPI-Resource-ProductImages-HTTPMethod-GET'>HTTP Method: GET</a></li>
            <li><a href='#RESTAPI-Resource-ProductImages-HTTPMethod-POST'>HTTP Method: POST</a></li>
        </ul>
        </li>
        <li><a href='#RESTAPI-Resource-ProductImages-URI--products--productid-images--imageid'>URI: /products/:product_id/images/:image_id</a>
        <ul>
            <li><a href='#RESTAPI-Resource-ProductImages-HTTPMethod-GET'>HTTP Method: GET</a></li>
            <li><a href='#RESTAPI-Resource-ProductImages-HTTPMethod-PUT'>HTTP Method: PUT</a></li>
            <li><a href='#RESTAPI-Resource-ProductImages-HTTPMethod-DELETE'>HTTP Method: DELETE</a></li>
        </ul>
        </li>
        <li><a href='#RESTAPI-Resource-ProductImages-URI--products--productid-images--imageid-store--storeid'>URI: /products/:product_id/images/:image_id/store/:store_id</a>
        <ul>
            <li><a href='#RESTAPI-Resource-ProductImages-HTTPMethod-GET'>HTTP Method: GET</a></li>
            <li><a href='#RESTAPI-Resource-ProductImages-HTTPMethod-PUT'>HTTP Method: PUT</a></li>
            <li><a href='#RESTAPI-Resource-ProductImages-HTTPMethod-DELETE'>HTTP Method: DELETE</a></li>
        </ul>
        </li>
    </ul>
    </li>
    <li><a href='#RESTAPI-Resource-ProductImages-PossibleHTTPStatusCodes'>Possible HTTP Status Codes</a></li>
</ul>


<h3><a name="RESTAPI-Resource-ProductImages-RESTAPI-ProductImages"></a>REST API: Product Images</h3>

<h4><a name="RESTAPI-Resource-ProductImages-URI--products--productid-images"></a>URI: /products/:product_id/images</h4>

<p>Allows you to manage images of the required product.</p>

<p><b>URL Structure</b>: <a href="http://magentohost/api/rest/products/:product_id/images">http://magentohost/api/rest/products/:product_id/images</a><br/>
<b>Version</b>: 1</p>

<h5><a name="RESTAPI-Resource-ProductImages-HTTPMethod-GET"></a>HTTP Method: GET</h5>

<p><b>描述</b>: Allows you to retrieve information about all images of a specified product.<br/>
<b>Notes</b>: If there are custom attributes with the <b>Catalog Input Type for Store Owner</b> option set to <b>Media Image</b>, these attributes will be also returned in the response as an image type.</p>


<p><b>Authentication</b>: Admin, Customer, Guest<br/>
<b>Default Format</b>: XML<br/>
<b>Parameters</b>:<br/>
<em>No Parameters</em></p>

<p><b>Example:</b></p>

<div class='panelMacro'><table class='infoMacro'><tr><td>GET <a href="http://magentohost/api/rest/products/8/images">http://magentohost/api/rest/products/8/images</a></td></tr></table></div>

<p><b>Response Body:</b></p>
<div class="panel" style="border-width: 1px;"><div class="panelContent">
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: java; gutter: false">&lt;?xml version="1.0"?&gt;
&lt;magento_api&gt;
  &lt;data_item&gt;
    &lt;id&gt;5&lt;/id&gt;
    &lt;label&gt;&lt;/label&gt;
    &lt;position&gt;1&lt;/position&gt;
    &lt;exclude&gt;0&lt;/exclude&gt;
    &lt;url&gt;http://magento/media/catalog/product/v/e/ve2011.jpg&lt;/url&gt;
    &lt;types&gt;
      &lt;data_item&gt;image&lt;/data_item&gt;
      &lt;data_item&gt;thumbnail&lt;/data_item&gt;
    &lt;/types&gt;
  &lt;/data_item&gt;
  &lt;data_item&gt;
    &lt;id&gt;7&lt;/id&gt;
    &lt;label&gt;second dress&lt;/label&gt;
    &lt;position&gt;2&lt;/position&gt;
    &lt;exclude&gt;1&lt;/exclude&gt;
    &lt;url&gt;http://magento/media/catalog/product/1/2/12.jpg&lt;/url&gt;
    &lt;types&gt;
      &lt;data_item&gt;small_image&lt;/data_item&gt;
    &lt;/types&gt;
  &lt;/data_item&gt;
&lt;/magento_api&gt;</pre>
		</div>
</div></div>
</div></div>


<h5><a name="RESTAPI-Resource-ProductImages-HTTPMethod-POST"></a>HTTP Method: POST</h5>

<p><b>描述</b>: Allows you to add an image for the required product.</p>


<p><b>Authentication</b>: Admin<br/>
<b>Default Format</b>: XML<br/>
<b>Parameters</b>:</p>


<table><tbody>
<tr>
<th> Name </th>
<th> Description </th>
<th> Required </th>
<th> Type </th>
<th> Example Value </th>
</tr>
<tr>
<td> file_mime_type </td>
<td> File mime type. Can have the following values: image/jpeg, image/png, 等. </td>
<td> required </td>
<td> string </td>
<td> image/jpeg </td>
</tr>
<tr>
<td> file_content </td>
<td> Graphic image file content (base_64 encoded) </td>
<td> required </td>
<td> string </td>
<td> iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWtJREFUeNpi/P//P8NgBkwMgxyMOnDUgTDAyMhIDNYF4vNA/B+IDwCxHLoakgEoFxODiQRXQUYi4e3k2gfDjMRajsP3zED8F8pmA+JvUDEYeArEMugOpFcanA/Ef6A0CPwC4uNoag5SnAjJjGI2tKhkg4rLAfFGIH4IxEuBWIjSKKYkDfZCHddLiwChVhokK8YGohwEZYy3aBmEKmDEhOCgreomo+VmZHxsMEQxIc2MAx3FO/DI3RxMmQTZkI9ALDCaSUYdOOrAIeRAPzQ+PxCHUM2FFDb5paGNBPRa5C20bUhxc4sSB4JaLnvxVHWHsbVu6OnACjyOg+HqgXKgGRD/JMKBoD6LDb0dyAPE94hwHAw/hGYcujlwEQmOg+EV9HJgLBmOg+FMWjsQVKR8psCBoDSrQqoDSSmoG6Hpj1wA6ju30LI9+BBX4UsC+Ai0T4BWVd1EIL5PgeO+APECmoXgaGtm1IE0AgABBgAJAICuV8dAUAAAAABJRU5ErkJggg== </td>
</tr>
<tr>
<td> file_name </td>
<td> Name for the added image file </td>
<td> optional </td>
<td> string </td>
<td> new image </td>
</tr>
</tbody></table>


<p><b>Note</b>: If the file_name parameter is not defined, the original file name is set for the image. The first created image will be called "image", the second created image will be called "image_2", 等.</p>

<p><b>Example:</b></p>

<div class='panelMacro'><table class='infoMacro'><tr><td>POST <a href="http://magentohost/api/rest/products/1/images">http://magentohost/api/rest/products/1/images</a></td></tr></table></div>

<p><b>Request Body:</b></p>
<div class="panel" style="border-width: 1px;"><div class="panelContent">
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: java; gutter: false">&lt;?xml version="1.0"?&gt;
&lt;magento_api&gt;
  &lt;file_mime_type&gt;image/jpeg&lt;/file_mime_type&gt;     &lt;file_content&gt;iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWtJREFUeNpi/P//P8NgBkwMgxyMOnDUgTDAyMhIDNYF4vNA/B+IDwCxHLoakgEoFxODiQRXQUYi4e3k2gfDjMRajsP3zED8F8pmA+JvUDEYeArEMugOpFcanA/Ef6A0CPwC4uNoag5SnAjJjGI2tKhkg4rLAfFGIH4IxEuBWIjSKKYkDfZCHddLiwChVhokK8YGohwEZYy3aBmEKmDEhOCgreomo+VmZHxsMEQxIc2MAx3FO/DI3RxMmQTZkI9ALDCaSUYdOOrAIeRAPzQ+PxCHUM2FFDb5paGNBPRa5C20bUhxc4sSB4JaLnvxVHWHsbVu6OnACjyOg+HqgXKgGRD/JMKBoD6LDb0dyAPE94hwHAw/hGYcujlwEQmOg+EV9HJgLBmOg+FMWjsQVKR8psCBoDSrQqoDSSmoG6Hpj1wA6ju30LI9+BBX4UsC+Ai0T4BWVd1EIL5PgeO+APECmoXgaGtm1IE0AgABBgAJAICuV8dAUAAAAABJRU5ErkJggg==&lt;/file_content&gt;
&lt;/magento_api&gt;</pre>
		</div>
</div></div>
</div></div>




<h4><a name="RESTAPI-Resource-ProductImages-URI--products--productid-images-store--storeid"></a>URI: /products/:product_id/images/store/:store_id</h4>

<p>Allows you to manage product images for a specified store.</p>

<p><b>URL Structure</b>: <a href="http://magentohost/api/rest/products/:product_id/images/store/:store_id">http://magentohost/api/rest/products/:product_id/images/store/:store_id</a><br/>
<b>Version</b>: 1</p>

<h5><a name="RESTAPI-Resource-ProductImages-HTTPMethod-GET"></a>HTTP Method: GET</h5>

<p><b>描述</b>: Allows you to retrieve information about product images for a specified store view.<br/>
<b>Notes:</b> Images can have different labels for different stores. 例如， image label "flower" in the English store view can be set as "fleur" in the French store view. If there are custom attributes with the <b>Catalog Input Type for Store Owner</b> option set to <b>Media Image</b>, these attributes will be also returned in the response as an image type.</p>


<p><b>Authentication</b>: Admin, Customer, Guest<br/>
<b>Default Format</b>: XML<br/>
<b>Parameters</b>:<br/>
<em>No Parameters</em></p>

<p><b>Example:</b></p>

<div class='panelMacro'><table class='infoMacro'><tr><td>GET <a href="http://magentohost/api/rest/products/8/images/store/2">http://magentohost/api/rest/products/8/images/store/2</a></td></tr></table></div>

<p><b>Response Body:</b></p>
<div class="panel" style="border-width: 1px;"><div class="panelContent">
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: java; gutter: false">&lt;?xml version="1.0"?&gt;
&lt;magento_api&gt;
  &lt;data_item&gt;
    &lt;id&gt;6&lt;/id&gt;
    &lt;label&gt;white dress&lt;/label&gt;
    &lt;position&gt;1&lt;/position&gt;
    &lt;exclude&gt;0&lt;/exclude&gt;
    &lt;url&gt;http://magento/media/catalog/product/1/2/12.jpg&lt;/url&gt;
    &lt;types&gt;
      &lt;data_item&gt;image&lt;/data_item&gt;
      &lt;data_item&gt;small_image&lt;/data_item&gt;
      &lt;data_item&gt;thumbnail&lt;/data_item&gt;
    &lt;/types&gt;
  &lt;/data_item&gt;
&lt;/magento_api&gt;</pre>
		</div>
</div></div>
</div></div>


<h5><a name="RESTAPI-Resource-ProductImages-HTTPMethod-POST"></a>HTTP Method: POST</h5>

<p><b>描述</b>: Allows you to add an image for the required product with image settings for a specific store.<br/>
<b>Notes</b>: The image is added on the Global level; specified image parameters are set for a specific store.</p>

<p><b>Authentication</b>: Admin<br/>
<b>Default Format</b>: XML<br/>
<b>Parameters</b>:</p>


<table><tbody>
<tr>
<th> Name </th>
<th> Description </th>
<th> Required </th>
<th> Type </th>
<th> Example Value </th>
</tr>
<tr>
<td> file_mime_type </td>
<td> File mime type. Can have the following values: image/jpeg, image/png, 等. </td>
<td> required </td>
<td> string </td>
<td> image/png </td>
</tr>
<tr>
<td> file_content </td>
<td> Graphic image file content (base_64 encoded) </td>
<td> required </td>
<td> string </td>
<td> iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWtJREFUeNpi/P//P8NgBkwMgxyMOnDUgTDAyMhIDNYF4vNA/B+IDwCxHLoakgEoFxODiQRXQUYi4e3k2gfDjMRajsP3zED8F8pmA+JvUDEYeArEMugOpFcanA/Ef6A0CPwC4uNoag5SnAjJjGI2tKhkg4rLAfFGIH4IxEuBWIjSKKYkDfZCHddLiwChVhokK8YGohwEZYy3aBmEKmDEhOCgreomo+VmZHxsMEQxIc2MAx3FO/DI3RxMmQTZkI9ALDCaSUYdOOrAIeRAPzQ+PxCHUM2FFDb5paGNBPRa5C20bUhxc4sSB4JaLnvxVHWHsbVu6OnACjyOg+HqgXKgGRD/JMKBoD6LDb0dyAPE94hwHAw/hGYcujlwEQmOg+EV9HJgLBmOg+FMWjsQVKR8psCBoDSrQqoDSSmoG6Hpj1wA6ju30LI9+BBX4UsC+Ai0T4BWVd1EIL5PgeO+APECmoXgaGtm1IE0AgABBgAJAICuV8dAUAAAAABJRU5ErkJggg== </td>
</tr>
<tr>
<td> file_name </td>
<td> Name for the added image file </td>
<td> optional </td>
<td> string </td>
<td> test image </td>
</tr>
</tbody></table>


<p><b>Note</b>: If the file_name parameter is not defined, the original file name is set for the image. The first created image will be called "image", the second created image will be called "image_2", 等.</p>

<p><b>Example:</b></p>

<div class='panelMacro'><table class='infoMacro'><tr><td>POST <a href="http://magentohost/api/rest/products/8/images/store/3">http://magentohost/api/rest/products/8/images/store/3</a></td></tr></table></div>

<p><b>Request Body:</b></p>
<div class="panel" style="border-width: 1px;"><div class="panelContent">
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: java; gutter: false">&lt;?xml version="1.0"?&gt;
&lt;magento_api&gt;
  &lt;file_mime_type&gt;image/jpeg&lt;/file_mime_type&gt;    &lt;file_content&gt;iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWtJREFUeNpi/P//P8NgBkwMgxyMOnDUgTDAyMhIDNYF4vNA/B+IDwCxHLoakgEoFxODiQRXQUYi4e3k2gfDjMRajsP3zED8F8pmA+JvUDEYeArEMugOpFcanA/Ef6A0CPwC4uNoag5SnAjJjGI2tKhkg4rLAfFGIH4IxEuBWIjSKKYkDfZCHddLiwChVhokK8YGohwEZYy3aBmEKmDEhOCgreomo+VmZHxsMEQxIc2MAx3FO/DI3RxMmQTZkI9ALDCaSUYdOOrAIeRAPzQ+PxCHUM2FFDb5paGNBPRa5C20bUhxc4sSB4JaLnvxVHWHsbVu6OnACjyOg+HqgXKgGRD/JMKBoD6LDb0dyAPE94hwHAw/hGYcujlwEQmOg+EV9HJgLBmOg+FMWjsQVKR8psCBoDSrQqoDSSmoG6Hpj1wA6ju30LI9+BBX4UsC+Ai0T4BWVd1EIL5PgeO+APECmoXgaGtm1IE0AgABBgAJAICuV8dAUAAAAABJRU5ErkJggg==&lt;/file_content&gt;
&lt;/magento_api&gt;</pre>
		</div>
</div></div>
</div></div>



<h4><a name="RESTAPI-Resource-ProductImages-URI--products--productid-images--imageid"></a>URI: /products/:product_id/images/:image_id</h4>

<p>Allows you to manage a specified product image.</p>

<p><b>URL Structure</b>: <a href="http://magentohost/api/rest/products/:product_id/images/:image_id">http://magentohost/api/rest/products/:product_id/images/:image_id</a><br/>
<b>Version</b>: 1</p>


<h5><a name="RESTAPI-Resource-ProductImages-HTTPMethod-GET"></a>HTTP Method: GET</h5>

<p><b>描述</b>: Allows you to retrieve information about a specified product image.<br/>
<b>Notes</b>: If there are custom attributes with the <b>Catalog Input Type for Store Owner</b> option set to <b>Media Image</b>, these attributes will be also returned in the response as an image type.</p>


<p><b>Authentication</b>: Admin, Customer, Guest<br/>
<b>Default Format</b>: XML<br/>
<b>Parameters</b>:<br/>
<em>No Parameters</em></p>

<p><b>Example:</b></p>

<div class='panelMacro'><table class='infoMacro'><tr><td>GET <a href="http://magentohost/api/rest/products/8/images/7">http://magentohost/api/rest/products/8/images/7</a></td></tr></table></div>

<p><b>Response Body:</b></p>
<div class="panel" style="border-width: 1px;"><div class="panelContent">
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: java; gutter: false">&lt;?xml version="1.0"?&gt;
&lt;magento_api&gt;
  &lt;id&gt;7&lt;/id&gt;
  &lt;label&gt;second dress&lt;/label&gt;
  &lt;position&gt;2&lt;/position&gt;
  &lt;exclude&gt;1&lt;/exclude&gt;
  &lt;url&gt;http://magento/media/catalog/product/1/2/12.jpg&lt;/url&gt;
  &lt;types&gt;
    &lt;data_item&gt;small_image&lt;/data_item&gt;
  &lt;/types&gt;
&lt;/magento_api&gt;</pre>
		</div>
</div></div>
</div></div>


<h5><a name="RESTAPI-Resource-ProductImages-HTTPMethod-PUT"></a>HTTP Method: PUT</h5>

<p><b>描述</b>: Allows you to update information for the specified product image.<br/>
<b>Notes</b>: When updating information, you need to pass only those parameters that you want to be updated. Parameters that were not passed in the request, will preserve the previous values.</p>


<p><b>Authentication</b>: Admin<br/>
<b>Default Format</b>: XML<br/>
<b>Parameters</b>:</p>


<table><tbody>
<tr>
<th> Name </th>
<th> Description </th>
<th> Required </th>
<th> Type </th>
<th> Example </th>
</tr>
<tr>
<td> exclude </td>
<td> Defines whether the image will associate only to one of the three image types. </td>
<td> optional </td>
<td> int </td>
<td> 0 </td>
</tr>
<tr>
<td> file_content </td>
<td> Image file content (base_64 encoded). </td>
<td> optional </td>
<td> string </td>
<td> base_64 encoded file content </td>
</tr>
<tr>
<td> file_mime_type </td>
<td> File mime type. Can have the following values: image/jpeg, image/png, 等. </td>
<td> optional </td>
<td> string </td>
<td> image/png </td>
</tr>
<tr>
<td> file_name </td>
<td> Image file name. </td>
<td> optional&nbsp; </td>
<td> string </td>
<td> test name </td>
</tr>
<tr>
<td> label </td>
<td> A label that will be displayed on the frontend when pointing to the image </td>
<td> optional </td>
<td> string </td>
<td> test label </td>
</tr>
<tr>
<td> position </td>
<td> The Sort Order option. The order in which the images are displayed in the MORE VIEWS section. </td>
<td> optional </td>
<td> int </td>
<td> 1 </td>
</tr>
<tr>
<td> types </td>
<td> Array of image types. Can have the following values: image, small_image, and thumbnail. </td>
<td> optional </td>
<td> array </td>
<td> thumbnail </td>
</tr>
</tbody></table>




<p><b>Example:</b></p>

<div class='panelMacro'><table class='infoMacro'><tr><td>PUT <a href="http://magentohost/api/rest/products/8/images/7">http://magentohost/api/rest/products/8/images/7</a></td></tr></table></div>

<p><b>Request Body:</b></p>
<div class="panel" style="border-width: 1px;"><div class="panelContent">
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: java; gutter: false">&lt;?xml version="1.0"?&gt;
&lt;magento_api&gt;
  &lt;label&gt;English store image&lt;/label&gt;
  &lt;position&gt;3&lt;/position&gt;
  &lt;exclude&gt;0&lt;/exclude&gt;
  &lt;types&gt;
      &lt;data_item&gt;image&lt;/data_item&gt;
      &lt;data_item&gt;small_image&lt;/data_item&gt;
      &lt;data_item&gt;thumbnail&lt;/data_item&gt;
   &lt;/types&gt;
&lt;/magento_api&gt;</pre>
		</div>
</div></div>
</div></div>







<h5><a name="RESTAPI-Resource-ProductImages-HTTPMethod-DELETE"></a>HTTP Method: DELETE</h5>

<p><b>描述</b>: Allows you to remove the specified image from a product.<br/>
<b>Notes</b>: The image will not be deleted physically, the image parameters will be set to No Image.</p>


<p><b>Authentication</b>: Admin<br/>
<b>Default Format</b>: XML<br/>
<b>Parameters</b>:<br/>
<em>No Parameters</em></p>

<p><b>Example:</b></p>

<div class='panelMacro'><table class='infoMacro'><tr><td>DELETE <a href="http://magentohost/api/rest/products/14/images/6">http://magentohost/api/rest/products/14/images/6</a></td></tr></table></div>




<h4><a name="RESTAPI-Resource-ProductImages-URI--products--productid-images--imageid-store--storeid"></a>URI: /products/:product_id/images/:image_id/store/:store_id</h4>

<p>Allows you to manage a specified product image for a specified store.</p>

<p><b>URL Structure</b>: <a href="http://magentohost/api/rest/products/:product_id/images/:image_id/store/:store_id">http://magentohost/api/rest/products/:product_id/images/:image_id/store/:store_id</a><br/>
<b>Version</b>: 1</p>


<h5><a name="RESTAPI-Resource-ProductImages-HTTPMethod-GET"></a>HTTP Method: GET</h5>

<p><b>描述</b>: Allows you to retrieve information about the specified product image from a specified store.<br/>
<b>Notes</b>: If there are custom attributes with the <b>Catalog Input Type for Store Owner</b> option set to <b>Media Image</b>, these attributes will be also returned in the response as an image type.</p>


<p><b>Authentication</b>: Admin, Customer, Guest<br/>
<b>Default Format</b>: XML<br/>
<b>Parameters</b>:<br/>
<em>No Parameters</em></p>

<p><b>Example:</b></p>

<div class='panelMacro'><table class='infoMacro'><tr><td>GET <a href="http://magentohost/api/rest/products/8/images/7/store/3">http://magentohost/api/rest/products/8/images/7/store/3</a></td></tr></table></div>

<p><b>Response Body:</b></p>
<div class="panel" style="border-width: 1px;"><div class="panelContent">
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: java; gutter: false">&lt;?xml version="1.0"?&gt;
&lt;magento_api&gt;
  &lt;id&gt;10&lt;/id&gt;
  &lt;label&gt;&lt;/label&gt;
  &lt;position&gt;5&lt;/position&gt;
  &lt;exclude&gt;1&lt;/exclude&gt;
  &lt;url&gt;http://magento/media/catalog/product/n/e/new_image.gif&lt;/url&gt;
  &lt;types/&gt;
&lt;/magento_api&gt;</pre>
		</div>
</div></div>
</div></div>




<h5><a name="RESTAPI-Resource-ProductImages-HTTPMethod-PUT"></a>HTTP Method: PUT</h5>

<p><b>描述</b>: Allows you to update the specified product image information for s specified store.<br/>
<b>Notes</b>: When updating information, you need to pass only those parameters that you want to be updated. Parameters that were not passed in the request will preserve the previous values.</p>


<p><b>Authentication</b>: Admin<br/>
<b>Default Format</b>: XML<br/>
<b>Parameters</b>:</p>


<table><tbody>
<tr>
<th> Name </th>
<th> Description </th>
<th> Required </th>
<th> Type </th>
<th> Example </th>
</tr>
<tr>
<td> exclude </td>
<td> Defines whether the image will associate only to one of the three image types. </td>
<td> optional </td>
<td> int </td>
<td> 0 </td>
</tr>
<tr>
<td> file_content </td>
<td> Image file content (base_64 encoded). </td>
<td> optional </td>
<td> string </td>
<td> base_64 encoded file content </td>
</tr>
<tr>
<td> file_mime_type </td>
<td> File mime type. Can have the following values: image/jpeg, image/png, 等. </td>
<td> optional </td>
<td> string </td>
<td> image/png </td>
</tr>
<tr>
<td> file_name </td>
<td> Image file name. </td>
<td> optional </td>
<td> string </td>
<td> test name </td>
</tr>
<tr>
<td> label </td>
<td> A label that will be displayed on the frontend when pointing to the image </td>
<td> optional </td>
<td> string </td>
<td> test label </td>
</tr>
<tr>
<td> position </td>
<td> The Sort Order option. The order in which the images are displayed in the MORE VIEWS section. </td>
<td> optional </td>
<td> int </td>
<td> 1 </td>
</tr>
<tr>
<td> types </td>
<td> Array of image types. Can have the following values: image, small_image, and thumbnail. </td>
<td> optional </td>
<td> array </td>
<td> thumbnail </td>
</tr>
</tbody></table>




<p><b>Example:</b></p>

<div class='panelMacro'><table class='infoMacro'><tr><td>PUT <a href="http://magentohost/api/rest/products/8/images/7/store/3">http://magentohost/api/rest/products/8/images/7/store/3</a></td></tr></table></div>

<p><b>Request Body:</b></p>
<div class="panel" style="border-width: 1px;"><div class="panelContent">
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: java; gutter: false">&lt;?xml version="1.0"?&gt;
&lt;magento_api&gt;
  &lt;position&gt;3&lt;/position&gt;
  &lt;exclude&gt;0&lt;/exclude&gt;
  &lt;types&gt;
      &lt;data_item&gt;image&lt;/data_item&gt;
   &lt;/types&gt;
&lt;/magento_api&gt;</pre>
		</div>
</div></div>
</div></div>



<h5><a name="RESTAPI-Resource-ProductImages-HTTPMethod-DELETE"></a>HTTP Method: DELETE</h5>

<p><b>描述</b>: Allows you to remove an image from the required product in the specified store.<br/>
<b>Notes</b>: The image will not be deleted physically, the image parameters will be set to No Image for the current store.</p>

<p><b>Authentication</b>: Admin<br/>
<b>Default Format</b>: XML<br/>
<b>Parameters</b>:<br/>
<em>No Parameters</em></p>

<p><b>Example:</b></p>

<div class='panelMacro'><table class='infoMacro'><tr><td>DELETE <a href="http://magentohost/api/rest/products/14/images/6/store/3">http://magentohost/api/rest/products/14/images/6/store/3</a></td></tr></table></div>




<h3><a name="RESTAPI-Resource-ProductImages-PossibleHTTPStatusCodes"></a>Possible HTTP Status Codes</h3>


<table><tbody>
<tr>
<th> Status Code </th>
<th> Message </th>
<th> Description </th>
</tr>
<tr>
<td> 400 </td>
<td> Requested store is invalid <br class="atl-forced-newline" /> </td>
<td> The specified store is not valid or does not exist </td>
</tr>
<tr>
<td> 404 </td>
<td> Resource not found </td>
<td> The specified resource is not found or does not exist </td>
</tr>
<tr>
<td> 404 </td>
<td> Product image not found </td>
<td> The specified product image is not found or does not exist </td>
</tr>
<tr>
<td> 400 </td>
<td> Resource data pre-validator error </td>
<td> Resource validation error </td>
</tr>
<tr>
<td> 400 </td>
<td> The image content must be valid base64 encoded data <br class="atl-forced-newline" /> </td>
<td> The image file content must be in the base_64 encoded format (when image content does not contain supported letters and symbols) </td>
</tr>
<tr>
<td> 400 </td>
<td> Requested product does not support images <br class="atl-forced-newline" /> </td>
<td> The specified product does not support images adding </td>
</tr>
<tr>
<td> 400 </td>
<td> Unsupported image MIME type <br class="atl-forced-newline" /> </td>
<td> The image MIME type is not supported (e.g., image/bmp) </td>
</tr>
<tr>
<td> 400 </td>
<td> Resource unknown error <br class="atl-forced-newline" /> </td>
<td> Resource unknown error </td>
</tr>
<tr>
<td> 500 </td>
<td> Resource internal error <br class="atl-forced-newline" /> </td>
<td> Resource internal error </td>
</tr>
<tr>
<td> &#45; </td>
<td> The image is not specified <br class="atl-forced-newline" /> </td>
<td> The image is not specified during the POST request. </td>
</tr>
</tbody></table>


<?php include(__ROOT__ . 'footer.php'); ?>		    
